Skip to content

Conversation

@AlisdairM
Copy link
Contributor

Add a note about the transience of comments, that are immediately replaced by space characters as they are parsed.

@eisenwave eisenwave added the P3-Other Triaged issue not in P1 or P2 label Nov 5, 2025
Add a note about the transience of comments, that are
immediately replaced by space characters as they are
parsed.
@AlisdairM AlisdairM force-pushed the add_phase3_note_to_comments branch from 12f80ed to 275b35c Compare November 12, 2025 22:48
Comment on lines +529 to +531
Comments are turned into \unicode{0020}{space} characters in
phase 3 of translation as part of decomposing a source file into
preprocessing tokens and sequences of whitespace characters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lex.phases p3 says a bit much in that location.

Maybe it's better to move the normative provision "Each comment (5.4) is replaced by one u+0020 space character." here or into lex.pptoken, possibly as part of the "whitespace grammar" paper.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was reluctant to touch the phases of translation more than necessary in P3657, the whitespace grammar paper. However, if we prefer that direction I will updated the next revision of that paper and close this PR.

@jensmaurer jensmaurer added after-motions Pull request is to be applied after the pending edits from WG21 straw polls have been applied. and removed after-motions Pull request is to be applied after the pending edits from WG21 straw polls have been applied. labels Dec 6, 2025
@AlisdairM
Copy link
Contributor Author

Will propose more significant changes as part of P3657.

@AlisdairM AlisdairM closed this Dec 6, 2025
AlisdairM added a commit to AlisdairM/draft that referenced this pull request Dec 9, 2025
The specification of phase 3 of translation says too much about
how things are done rather than what is done.  Per suggestions
on PR cplusplus#8414, move the precise handling of comments to [lex.comment].
As this move relies on the specificatin for whitespace, move the
definition of whitespace from [lex.pptoken] to [lex.comment] too.]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3-Other Triaged issue not in P1 or P2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants